package com.ruoyi.business.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TSmjOrderInfoMapper;
import com.ruoyi.business.domain.TSmjOrderInfo;
import com.ruoyi.business.service.ITSmjOrderInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 售卖机订单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-02
 */
@Service
public class TSmjOrderInfoServiceImpl implements ITSmjOrderInfoService 
{
    @Autowired
    private TSmjOrderInfoMapper tSmjOrderInfoMapper;

    /**
     * 查询售卖机订单信息
     * 
     * @param id 售卖机订单信息主键
     * @return 售卖机订单信息
     */
    @Override
    public TSmjOrderInfo selectTSmjOrderInfoById(Long id)
    {
        return tSmjOrderInfoMapper.selectTSmjOrderInfoById(id);
    }

    /**
     * 查询售卖机订单信息列表
     * 
     * @param tSmjOrderInfo 售卖机订单信息
     * @return 售卖机订单信息
     */
    @Override
    @DataScope(userAlias = "t")
    public List<TSmjOrderInfo> selectTSmjOrderInfoList(TSmjOrderInfo tSmjOrderInfo)
    {
        return tSmjOrderInfoMapper.selectTSmjOrderInfoList(tSmjOrderInfo);
    }

    @Override
    public List<TSmjOrderInfo> selectTSmjOrderInfoListByNoAuth(TSmjOrderInfo tSmjOrderInfo) {
        return tSmjOrderInfoMapper.selectTSmjOrderInfoListByNoAuth(tSmjOrderInfo);

    }

    /**
     * 新增售卖机订单信息
     * 
     * @param tSmjOrderInfo 售卖机订单信息
     * @return 结果
     */
    @Override
    public int insertTSmjOrderInfo(TSmjOrderInfo tSmjOrderInfo)
    {
        tSmjOrderInfo.setCreateTime(DateUtils.getNowDate());
        return tSmjOrderInfoMapper.insertTSmjOrderInfo(tSmjOrderInfo);
    }

    /**
     * 修改售卖机订单信息
     * 
     * @param tSmjOrderInfo 售卖机订单信息
     * @return 结果
     */
    @Override
    public int updateTSmjOrderInfo(TSmjOrderInfo tSmjOrderInfo)
    {
        tSmjOrderInfo.setUpdateTime(DateUtils.getNowDate());
        return tSmjOrderInfoMapper.updateTSmjOrderInfo(tSmjOrderInfo);
    }

    /**
     * 批量删除售卖机订单信息
     * 
     * @param ids 需要删除的售卖机订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTSmjOrderInfoByIds(String ids)
    {
        return tSmjOrderInfoMapper.deleteTSmjOrderInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售卖机订单信息信息
     * 
     * @param id 售卖机订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTSmjOrderInfoById(Long id)
    {
        return tSmjOrderInfoMapper.deleteTSmjOrderInfoById(id);
    }

    @Override
    public int deleteTSmjOrderInfo(TSmjOrderInfo tSmjOrderInfo) {
        return tSmjOrderInfoMapper.deleteTSmjOrderInfo(tSmjOrderInfo);
    }
}
